package com.ssy.lingxi.order.api.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.order.api.model.vo.paas.OrderPayChannelFeignVO;
import com.ssy.lingxi.order.api.model.vo.paas.OrderRuleFeignVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;
import java.util.List;

/**
 * 订单服务配置接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-04
 */
@FeignClient(name = "order-service")
public interface OrderConfigFeignService {

    /**
     * 同步更新平台规则配置
     * @param rules 接口参数
     * @return 更新结果
     */
    @RequestMapping(value = "/order/config/base/rule", method = RequestMethod.POST)
    Wrapper<Void> updateOrInsertOrderRules(@RequestBody @Valid List<OrderRuleFeignVO> rules);

    /**
     * 同步更新支付方式与支付渠道状态
     * @param payChannels 接口参数
     * @return 更新结果
     */
    @RequestMapping(value = "/order/config/base/pay/channel", method = RequestMethod.POST)
    Wrapper<Void> updateOrderPayChannelStatus(@RequestBody @Valid List<OrderPayChannelFeignVO> payChannels);
}
